@extends('layouts.base')
@section('title', '资源搜索结果')

@section('content')
    <div class="well">
        <h1 class="text-center lead text-danger">搜索关键字<span class="lead text-success">{{$_GET['keyword']}}</span>:搜索结果显示前200条,需要更详细结果请使用更详细关键字</h1>
        <table id="table" class="table table-condensed table-striped table-bordered table-responsive" data-page-length="100"
               data-toggle="table">
            <thead>
            <tr>
                <th>名称</th>
                <th>资源</th>
                <th>集数</th>
                <th>大小</th>
                <th>时间</th>
            </tr>
            </thead>

            <tbody>
            @foreach($episodes as $episode)
                <tr>
                    <td align="center" class="col-md-5 col-xs-6 over-flow-td">
                        <span hidden>{{$episode->name}}</span>
                        <a href="{{route('episode.show',$episode->id)}}"
                           title="{{$episode->raw_name}}">{{$episode->name}}</a>
                    </td>
                    <td align="center" valign="middle" class="col-md-3 col-xs-3">
                        @if(strlen($episode->url_baidupan)>1)
                            <a href={{$episode->url_baidupan}} title="百度网盘下载" rel="nofollow" target="_blank"><img
                                        src="/web-icon/baidu-icon.png" class="download-icon"></a>
                        @endif
                        @if(strlen($episode->url_torrent)>1)
                            <a href="{{$episode->url_torrent}}" rel="nofollow" title="BT种子下载"
                               target="_blank"><img src="/web-icon/bt-icon.png" width="18" height="16"
                                                    class="bt-icon"></a></a>
                        @endif
                        @if(strlen($episode->url_magnet)>1)
                            <a href="{{$episode->url_magnet}}" rel="nofollow" title="磁力链接下载"
                               target="_blank"><img src="/web-icon/mag-icon.png"
                                                    class="download-icon"></a></a>
                            <a title="小米路由下载"
                               href="{{'https://d.miwifi.com/d2r/?url='.base64_encode($episode->url_magnet).'&name='.$episode->raw_name.'&src='.route('episode.show',$episode->id) }}"
                               rel="nofollow" target="_blank"><img src="/web-icon/mi-icon.png"
                                                                   class="download-icon"></a></a>
                        @endif

                        @if(strlen($episode->url_ed2k)>1)
                            <a href="{{$episode->url_ed2k}}" rel="nofollow" title="2dek电驴下载"
                               target="_blank"><img src="/web-icon/ed2k-icon.png"
                                                    class="download-icon"></a></a>
                        @endif
                        @if(strlen($episode->url_other)>1)
                            <a href="{{$episode->url_other}}" rel="nofollow" title="网盘下载"
                               target="_blank"><img src="/web-icon/other.png"
                                                    class="download-icon"></a></a>
                        @endif
                        @if(strlen($episode->url_video)>1)
                            <a href="{{$episode->url_video}}" rel="nofollow" title="视频在线播放"
                               target="_blank"><img src="/web-icon/video-icon.png" class="download-icon"></a></a>
                        @endif
                    </td>
                    <td align="center" class="col-md-1 hidden-xs">
                        <small>
                            s{{$episode->season}}e{{$episode->episode}}

                        </small>
                    </td>
                    <td align="center" class="col-md-2 hidden-xs">
                        <small title="{{$episode->size}}">{{$episode->size}}</small>
                    <td align="center" class="col-md-1 col-xs-3">
                        <small title="更新时间:{{$episode->updated_at}},创建时间:{{$episode->created_at}}">{{$episode->created_at}}</small>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
@endsection

